home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / SmallEiffel 0.3.3 / SmallEiffel 68k / lib_test / test_standard_is_equal.e < prev    next >
Encoding:
Text File  |  1996-06-13  |  1.4 KB  |  68 lines  |  [TEXT/EDIT]

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_STANDARD_IS_EQUAL
  5.  
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    make is
  12.       local
  13.      animal1, animal2: ANIMAL;
  14.      p1, p2: POINT;
  15.      t1, t2: TRIANGLE;
  16.      any1, any2: ANY;
  17.      cp1, cp2: COLORED_POINT;
  18.       do
  19.      is_true(not ("foo").standard_is_equal("foo"));
  20.      is_true(not ("bar").standard_is_equal("foo"));
  21.      
  22. -- ?? ELKS ?? --     is_true((3).standard_is_equal(3));
  23. -- ?? ELKS ?? --     is_true((2 + 2).standard_is_equal(1 + 3));
  24.  
  25.      
  26.      !DOG!animal1;
  27.      !CAT!animal1;
  28.      !CAT!animal2;
  29.      is_true(animal1.standard_is_equal(animal2));
  30.      
  31.      !!p1.make(1.5,2.5);
  32.      !!p2.make(1.5,2.5);
  33.      is_true(p1.standard_is_equal(p2));
  34.      is_true(p2.standard_is_equal(p1));
  35.      
  36.      any1 := p1;
  37.      any2 := p2;
  38.      is_true(any1.standard_is_equal(any2));
  39.      is_true(any2.standard_is_equal(any1));
  40.      
  41.      !!cp1.make(1.5,2.5,"red");
  42.      !!cp2.make(1.5,2.5,"red");
  43.      is_true(not cp1.standard_is_equal(cp2));
  44.      
  45.      any1 := cp1;
  46.      any2 := cp1;
  47.      is_true(any1.standard_is_equal(any2));
  48.      any2 := cp2;
  49.      is_true(not any1.standard_is_equal(any2));
  50.      
  51.       end;
  52.    
  53.    is_true(b: BOOLEAN) is
  54.       do
  55.      cpt := cpt + 1;
  56.      if not b then
  57.         std_output.put_string("TEST_STANDARD_IS_EQUAL: ERROR Test # ");
  58.         std_output.put_integer(cpt);
  59.         std_output.put_string("%N");
  60.      else
  61.         -- std_output.put_string("Yes %N");
  62.      end;
  63.       end;
  64.    
  65.    cpt: INTEGER;
  66.    
  67. end -- TEST_STANDARD_IS_EQUAL
  68.